package com.travel.WeChatPay;


import com.alibaba.fastjson.JSON;
import com.wechat.pay.java.service.payments.model.Transaction;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Map;

@Slf4j
@Service
public class WxPayService {


    public Map<String, Object> payment(BigDecimal price, String orderId, Long userId,String payType) throws Exception {
        Map<String, Object> result = WechatPayBo.payment(price, orderId, userId,payType);
        return result;
    }


    private String buildParse(Transaction parse){
        parse.setMchid(null);
        parse.setAppid(null);
        parse.setBankType(null);
        parse.setBankType(null);
        parse.setAttach(null);
        return JSON.toJSONString(parse);
    }
    /**
     *
     * @author Rick chou
     * @date 2024/7/16 11:03
     * 支付回调处理
     * 1.更新订单状态
     * 2.添加支付记录
     * 3.通知小程序
     *
     */


}
